package com.ruoyi.web.controller.pc;

import com.ruoyi.business.domain.WmsInWarehous;
import com.ruoyi.business.service.IWmsInWarehousService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 入库单管理 Controller
 *
 * @author patton
 * @date 2023-07-16
 */
@RestController
@RequestMapping("/business/inWarehous")
public class WmsInWarehousController extends BaseController {

    @Autowired
    private IWmsInWarehousService wmsInWarehousService;

    /**
     * @Description: 列表
     * @author yunlong
     */
    @ApiOperation(value = "列表")
    @GetMapping("list")
    @CrossOrigin
    public TableDataInfo queryList(WmsInWarehous info) {
        startPage();
        List<WmsInWarehous> list = wmsInWarehousService.selectWmsInWarehousList(info);
        return getDataTable(list);
    }

    /**
     * @Description: 详情
     * @author yunlong
     */
    @ApiOperation(value = "详情")
    @GetMapping("getDetail")
    @CrossOrigin
    public AjaxResult getDetail(WmsInWarehous info) {
        startPage();
        List<WmsInWarehous> list = wmsInWarehousService.selectWmsInWarehousList(info);
        return AjaxResult.success(list.get(0));
    }
}
